﻿package com.gambit.happilyeverafter.characters {
	import org.flixel.FlxSprite;
	import org.flixel.FlxG;
	
	/**
	 * ...
	 * @author William Hutama
	 */
	public class BaseCharacter extends FlxSprite {
		protected var _move_speed:int = 400;
		
		public function BaseCharacter(ImageClass:Class, x:Number, y:Number) {
			super(x, y);
			loadGraphic(ImageClass, true, true, 32, 32);
		}
		
		override public function update():void {
			if (FlxG.keys.LEFT) {
				facing = LEFT;
				velocity.x -= _move_speed * FlxG.elapsed;
			
			}
			else if (FlxG.keys.RIGHT) {
				facing = RIGHT;
				velocity.x += _move_speed * FlxG.elapsed;
			}
			
			super.update();
		}
	}

}